package com.feiaho.zhou.controller.exception;


import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@Component
@ControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(NullPointerException.class)
    @ResponseBody
    public String doNullPointException(){
        System.out.println("空指针异常！");
        return "nullPointException";
    }
}
